<script setup>
const hotProdcut = ref([
    { title: '麻辣香锅', image: '/static/temp/ad_xiangguo.jpeg' },
    { title: '珍珠手链', image: 'http://pic.rmb.bdstatic.com/819a044daa66718c2c40a48c1ba971e6.jpeg' }
]);
</script>
<template>
    <!-- 特惠推荐 -->
    <view class="caption">
        <text class="text">特惠推荐</text>
    </view>
    <view class="guess">
        <navigator class="guess-item" v-for="item in hotProdcut" :key="item" :url="'/pages/product/product?title=' + item.title">
            <image class="image" mode="aspectFill" :src="item.image"></image>
            <view class="name">{{ item.title }}</view>
            <text class="address">新街口新百大厦</text>
            <view class="price">
                <text class="small">¥</text>
                <text>199.0</text>
                <text class="original-price" style="margin-left: 8rpx">¥350.0</text>
            </view>
        </navigator>
    </view>
    <view class="loading-text" v-show="false">正在加载...</view>
</template>

<style lang="scss" scoped>
:host {
    display: block;
}
// 分类标题
.caption {
    display: flex;
    justify-content: center;
    line-height: 1;
    padding: 10rpx 0 10rpx;
    font-size: $list-font-base;
    color: orange;
    .text {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 28rpx 0 30rpx;
        &::before,
        &::after {
            content: '';
            width: 20rpx;
            height: 20rpx;
            background-image: url(@/static/icon/icn-line.png);
            background-size: contain;
            margin: 0 10rpx;
        }
    }
}
//  热销商品
.guess {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 10rpx;

    .guess-item {
        width: 310rpx;
        padding: 24rpx 20rpx 20rpx;
        margin-bottom: 20rpx;
        border-radius: 10rpx;
        overflow: hidden;
        background-color: #fff;
    }
    .image {
        width: 304rpx;
        height: 304rpx;
    }
    .name {
        height: 75rpx;
        margin: 10rpx 0;
        color: #262626;
        font-size: $list-font-lg;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .address {
        color: $uni-text-color-grey;
        font-size: $list-font-sm;
        margin-left: 2rpx;
        &::before {
            font-family: 'erabbit' !important;
            content: '\e6cb';
            width: 20rpx;
            height: 20rpx;
            background-size: contain;
        }
    }
    .price {
        line-height: 1;
        padding-top: 4rpx;
        color: orange;
        font-size: $list-font-base;
    }
    .small {
        font-size: 80%;
    }
}
.original-price {
    font-size: $list-font-sm;
    text-decoration: line-through;
    color: $font-color-light;
    margin-left: 8rpx;
}
// 加载提示文字
.loading-text {
    text-align: center;
    font-size: 28rpx;
    color: #666;
    padding: 20rpx 0;
}
</style>
